using System;
using System.Web;
using System.Collections;

namespace BurbleLite
{
	/// <summary>
	/// Summary description for SessionWrapper.
	/// </summary>
	public class SessionWrapper
	{
		public static string PublicPassword = "lockmart";
		public static string PublicKey= "lockmart";

		public static string UserName
		{
			get
			{
				if (HttpContext.Current.Session["UserName"] == null)
				{
					HttpContext.Current.Session["UserName"] = "";
				}
				return (string)HttpContext.Current.Session["UserName"];
			}
			set
			{
				HttpContext.Current.Session["UserName"] = value;
			}
		}

		public static History ChatHistory
		{
			get
			{
				if (HttpContext.Current.Application["ChatHistory"] == null)
				{
					HttpContext.Current.Application["ChatHistory"] = new History();
				}
				return (History)HttpContext.Current.Application["ChatHistory"];
			}
			set
			{
				HttpContext.Current.Application["ChatHistory"] = value;
			}
		}

		public static DateTime LastCleanup
		{
			get
			{
				if (HttpContext.Current.Application["LastCleanup"] == null)
				{
					HttpContext.Current.Application["LastCleanup"] = DateTime.Now;
				}
				return (DateTime)HttpContext.Current.Application["LastCleanup"];
			}
			set
			{
				HttpContext.Current.Application["LastCleanup"] = value;
			}
		}
	}
}
